package com.example.vv.frameWork.until;

import android.app.Activity;
import android.view.View;

import com.example.vv.R;
import com.example.vv.frameWork.view.MyAdapter;

public class UiUntil {
    public static   void listEmptyView(Activity activity, MyAdapter baseAdapter, View recyclerView){
        if(baseAdapter!=null){
            int itemCount = baseAdapter.getItemCount();
            View emptyView =activity.findViewById(R.id.load_faild_layout);
            if(emptyView!=null){
                if(itemCount==0){
                    emptyView.setVisibility(View.VISIBLE);
                    recyclerView.setVisibility(View.GONE);
                }else{
                    emptyView.setVisibility(View.GONE);
                    recyclerView.setVisibility(View.VISIBLE);
                }
            }

        }
    }
}
